n,L,t=map(int,input().split())

class node:
    index=-1
    v=0
    def __init__(self,index,v):
        self.index=index
        self.v=v

balls=[]

indexs=list(map(int,input().split()))
for index in indexs:
    if index!=L:
        balls.append(node(index,1))
    else:
        balls.append(node(index,-1))

while t>0:
    t-=1

    flag=[0 for i in range(0,L+1)]

    for i in range(0,n):
        balls[i].index+=balls[i].v
        flag[balls[i].index]+=1

    for i in range(0,n):
        if flag[balls[i].index]==2 or balls[i].index==0 or balls[i].index==L:
            balls[i].v=-balls[i].v


for i in range(0,n):
    print(balls[i].index,end=" ")
print("")